package com.example.demo.repository;

import com.example.demo.model.Klass;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface KlassRepository extends JpaRepository<Klass,String> {
    public List<Klass> findByName(String name);
    public List<Klass> findByNameAndMajor(String name,String major);

    public List<Klass> findByNameOrMajor(String name, String major);

    @Query(nativeQuery = true,value = "select * from klass where name = ?1")
    public List<Klass> findNativeQuery(String name);
}
